<div class="ticket" align="center">
	<h2>Thống kê, In ấn</h2>
	<div class="mTop10">
		<a href="ticket.html">Kiểm tra mã số phiếu</a> | <a href="report.html" style="color:red"><b>Thống kê, In ấn</b></a>
	</div>
	<div class="mTop10">
		<form name="reportForm" id="reportForm"  method="post" >
			<div>
				<div class="wrap_box">
					<div class="box" style="float:none" id="p5">
						<table cellpadding="0" cellspacing="5">
							<tr>
								<td><b>Từ ngày: </b></td>
								<td>
									<select name="from_day">
										{section start=1 loop=32 name=i}
											<option value="{$smarty.section.i.index}"{if $smarty.section.i.index==$from_day} selected{/if}>{if $smarty.section.i.index<=9}0{/if}{$smarty.section.i.index}</option>
										{/section}
									</select>
									<select name="from_mon">
										{section start=1 loop=13 name=i}
											<option value="{$smarty.section.i.index}"{if $smarty.section.i.index==$from_mon} selected{/if}>{if $smarty.section.i.index<=9}0{/if}{$smarty.section.i.index}</option>
										{/section}
									</select>
									<input type="text" name="from_year" value="{$from_year}" size="5"  maxlength="4" onfocus="this.select()" />
								</td>
							</tr>
							<tr>
								<td><b>Đến ngày: </b></td>
								<td>
									<select name="to_day">
										{section start=1 loop=32 name=i}
											<option value="{$smarty.section.i.index}"{if $smarty.section.i.index==$to_day} selected{/if}>{if $smarty.section.i.index<=9}0{/if}{$smarty.section.i.index}</option>
										{/section}
									</select>
									<select name="to_mon">
										{section start=1 loop=13 name=i}
											<option value="{$smarty.section.i.index}"{if $smarty.section.i.index==$to_mon} selected{/if}>{if $smarty.section.i.index<=9}0{/if}{$smarty.section.i.index}</option>
										{/section}
									</select>
									<input type="text" name="to_year" value="{$to_year}" size="5"  maxlength="4" onfocus="this.select()" />
								</td>
							</tr>
							<tr>
								<td><b>Sản phẩm: </b></td>
								<td>
									<select name="item_id">
										<option value="0">-- Tất cả --</option>
										{foreach from=$item_sel item=entry}
										<option value="{$entry.id}"{if $item_id==$entry.id} selected{/if}>{$entry.id} - {$entry.title_seo}</option>
										{/foreach}
									</select>
								</td>
							</tr>
							<tr>
								<td colspan="2" align="center">
									<div class="mTop10">
										<input type="submit" value="Thống kê" name="submit" />
										&nbsp;&nbsp;&nbsp;
										<input type="button" value="In kết quả" name="print" onclick="window.print()" />
									</div>
								</td>
							</tr>
						</table>
						
					</div>
					<div class="clb"></div>
				</div>
				<div class="clb"></div>
			</div>
		</form>
		
		{$msg}
		
		<div class="mTop10" id="sticky">
			<div class="mBottom10">Tổng cộng: <b>{$total}</b> phiếu</div>
			<table class="list sticky-enabled" cellpadding="0" cellspacing="0" width="100%">
				<thead>
					<tr>
						<th class="head bRight">STT</th>
						<th class="head bRight">Khách hàng</th>
						<th class="head bRight" width="80">Điện thoại</th>
						<th class="head bRight" width="40">Phiếu</th>
						<th class="head" width="55">Sử dụng</th>
					</tr>
				</thead>
				<tbody>
				{foreach from=$ticket item=ticket name=i}
					<tr class="{cycle values='bg1,bg2'}">
						<td align="center" class="bRight" style="padding:2px;border-bottom:1px solid #ddd">{$smarty.foreach.i.iteration}</td>
						<td class="bRight" style="padding:2px;border-bottom:1px solid #ddd">{$ticket.guest_create}</td>
						<td align="center" class="bRight" style="padding:2px;border-bottom:1px solid #ddd">{$ticket.phone}</td>
						<td align="center" class="bRight" style="padding:2px;border-bottom:1px solid #ddd"><b>{$ticket.ticket_code}</b></td>
						<td align="center" style="padding:2px;border-bottom:1px solid #ddd;color:green">{$ticket.time_using|date_format:"%d/%m/%Y %H:%I:%S"}</td>
					</tr>
				{/foreach}
				</tbody>
			</table>
		</div>
	</div>
</div>
